// Copyright (c) 2025-present AutoStories Contributors.
// All contributors are listed in CONTRIBUTORS.yaml at monorepo root.
//
// AutoStories is licensed under Mulan PSL v2.
// You can use this software according to the terms
// and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//
//   http://license.coscl.org.cn/MulanPSL2
//
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
//
// 上述开源协议注释乃程序自动生成，请勿编辑
// === Auto generated, DO NOT EDIT ABOVE ===

import 'package:auto_stories/auto_stories.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

import 'state.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  TextInput.ensureInitialized();
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) => const Layout()
      .animatedTheme(Theme.adapter(), Theme.lerp)
      .locale(adapter: localesOf([]))
      .mediaAsView(context);
}

class Layout extends StatelessWidget {
  const Layout({super.key});

  @override
  Widget build(BuildContext context) {
    final theme = context.find<Theme>()!;
    return 'AutoStories'
        .asText()
        .center()
        .sidebar(theme: theme.sidebar, sidebar: 'Sidebar'.asText().center())
        .safeArea();
  }
}
